package org.niu.array;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class MInNumberDisappeared {
    public int minNumberDisappeared (int[] nums) {
        Set<Integer>  set = new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            set.add(nums[i]);
        }
        for (int i = 1; i < 10000001; i++) {
            if(!set.contains(i)){
                return i;
            }
        }
        return Arrays.stream(nums).max().getAsInt()+1;
    }
}
